<div>
    <h2>
        <span id="metrics-page-heading" jhiTranslate="metrics.title">Application Metrics</span>

        <button (click)="refresh()" class="btn btn-primary float-right">
            <fa-icon icon="sync"></fa-icon>
            <span jhiTranslate="metrics.refresh.button">Refresh</span>
        </button>
    </h2>

    <h3 jhiTranslate="metrics.jvm.title">JVM Metrics</h3>

    <div *ngIf="metrics && !updatingMetrics" class="row">
        <jhi-jvm-memory
                [jvmMemoryMetrics]="metrics.jvm"
                [updating]="updatingMetrics"
                class="col-md-4">
        </jhi-jvm-memory>

        <jhi-jvm-threads
                [threadData]="threads"
                class="col-md-4">
        </jhi-jvm-threads>

        <jhi-metrics-system
                [systemMetrics]="metrics.processMetrics"
                [updating]="updatingMetrics"
                class="col-md-4">
        </jhi-metrics-system>
    </div>

    <div *ngIf="metrics && metricsKeyExists('garbageCollector')">
        <h3 jhiTranslate="metrics.jvm.gc.title">Garbage collector statistics</h3>

        <jhi-metrics-garbagecollector
                [garbageCollectorMetrics]="metrics.garbageCollector"
                [updating]="updatingMetrics">
        </jhi-metrics-garbagecollector>
    </div>

    <div *ngIf="updatingMetrics" class="well well-lg" jhiTranslate="metrics.updating">Updating...</div>

    <jhi-metrics-request
            *ngIf="metrics && metricsKeyExists('http.server.requests')"
            [requestMetrics]="metrics['http.server.requests']"
            [updating]="updatingMetrics">
    </jhi-metrics-request>

    <jhi-metrics-endpoints-requests
            *ngIf="metrics && metricsKeyExists('services')"
            [endpointsRequestsMetrics]="metrics.services"
            [updating]="updatingMetrics">
    </jhi-metrics-endpoints-requests>

    <jhi-metrics-cache
            *ngIf="metrics && metricsKeyExists('cache')"
            [cacheMetrics]="metrics.cache"
            [updating]="updatingMetrics">
    </jhi-metrics-cache>

    <jhi-metrics-datasource
            *ngIf="metrics && metricsKeyExistsAndObjectNotEmpty('databases')"
            [datasourceMetrics]="metrics.databases"
            [updating]="updatingMetrics">
    </jhi-metrics-datasource>
</div>
